﻿using ClassLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static ClassLibrary.Tools.HttpAPI;

namespace WindowsFormClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        }

        private void button_get_Click(object sender, EventArgs e)
        {
            string json = HttpRequest("127.0.0.1", "5000", "/api/OmegaTest", HttpType.GET,"");
        }

        private void button_post_Click(object sender, EventArgs e)
        {
            //string json = HttpRequest("127.0.0.1", "5000", "/api/OmegaTest/", HttpType.POST, "[\"A\",\"B\"]");

            string temp = ClassLibrary.Tools.HttpClientUtil.doPostMethodToObj<string>("api/OmegaTest", "[\"A2\",\"B2\"]");
        }

        private void button_put_Click(object sender, EventArgs e)
        {
            //string json = HttpRequest("127.0.0.1", "5000", "/api/OmegaTest/543", HttpType.PUT, "[\"A\",\"B\"]");

            string temp = ClassLibrary.Tools.HttpClientUtil.doPutMethod("api/OmegaTest/322", "[\"A3\",\"B3\"]");
        }

        private void button_delete_Click(object sender, EventArgs e)
        {
            //string json = HttpRequest("127.0.0.1", "5000", "/api/OmegaTest/456", HttpType.DELETE, "");

            bool temp = ClassLibrary.Tools.HttpClientUtil.doDeleteMethod("api/OmegaTest/987");
        }
    }
}
